using System;
using System.Collections;

using LocalBoard.Domain;
using LocalBoard.Persistence;

namespace LocalBoard.Controller
{
	/// <summary>
	/// Summary description for ProfileController.
	/// </summary>
	public class ProfileController
	{
		private IAccessorFactory _accessorFactory;

		public ProfileController(IAccessorFactory accessorFactory)
		{
			if(accessorFactory == null)
				throw new ArgumentException("Accessor Factory shouldn't be null", "accessorFactory");
			_accessorFactory = accessorFactory;
		}

		public int CreateProfile(Profile profile)
		{
			return _accessorFactory.GetProfileAccessor().Insert(profile);
		}

		public Profile GetProfile(int profileId)
		{
			return _accessorFactory.GetProfileAccessor().Get(profileId);
		}
	}
}
